<?php
    class block_imageBlock_controller extends controllerBase
    {
        public function process()
        {
            if($this->get('uri'))
            {
                $productUri = $this->get('uri');
                $oDatabase = new database();
                $sQuery = "
                PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
                PREFIX foaf: <http://xmlns.com/foaf/0.1/>
                PREFIX bus: <".URL::getLink('id/bussiness#').">

                SELECT * 
                FROM <".$productUri.">
                WHERE 
                {
                ?uri bus:image ?image.
                OPTIONAL{?uri bus:defaultImage ?defaultImage}.
                OPTIONAL{?uri bus:hotImage ?hotImage}.
                OPTIONAL{?uri bus:hightLightImage ?hightLightImage}.
                }";
                $aResult = $oDatabase->loadQuery($sQuery);
                if(!empty($aResult['result']['rows']))
                {
                    $this->aParams['aImages'] = $aResult['result']['rows'];
                }
            }
        }
    }
?>
